package com.zc.im.mapper.user;

import com.zc.im.model.user.ZcOwnWork;
import com.zc.im.model.user.ZcOwnWorkExample;
import com.zc.im.model.user.ZcOwnWorkKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ZcOwnWorkMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    int countByExample(ZcOwnWorkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    int deleteByExample(ZcOwnWorkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    @Delete({
        "delete from zc_own_work",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(ZcOwnWorkKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    @Insert({
        "insert into zc_own_work (id, res_id, ",
        "uid, company_name, ",
        "industry, position, ",
        "salary, describe, ",
        "start_time, end_time, ",
        "position_cn, position_type, ",
        "certifier, certifier_phone)",
        "values (#{id,jdbcType=INTEGER}, #{resId,jdbcType=INTEGER}, ",
        "#{uid,jdbcType=INTEGER}, #{companyName,jdbcType=VARCHAR}, ",
        "#{industry,jdbcType=VARCHAR}, #{position,jdbcType=VARCHAR}, ",
        "#{salary,jdbcType=TINYINT}, #{describe,jdbcType=VARCHAR}, ",
        "#{startTime,jdbcType=VARCHAR}, #{endTime,jdbcType=VARCHAR}, ",
        "#{positionCn,jdbcType=VARCHAR}, #{positionType,jdbcType=INTEGER}, ",
        "#{certifier,jdbcType=VARCHAR}, #{certifierPhone,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(ZcOwnWork record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    int insertSelective(ZcOwnWork record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    List<ZcOwnWork> selectByExample(ZcOwnWorkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "id, res_id, uid, company_name, industry, position, salary, describe, start_time, ",
        "end_time, position_cn, position_type, certifier, certifier_phone",
        "from zc_own_work",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ZcOwnWork selectByPrimaryKey(ZcOwnWorkKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    int updateByExampleSelective(@Param("record") ZcOwnWork record, @Param("example") ZcOwnWorkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    int updateByExample(@Param("record") ZcOwnWork record, @Param("example") ZcOwnWorkExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    int updateByPrimaryKeySelective(ZcOwnWork record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table zc_own_work
     *
     * @mbggenerated
     */
    @Update({
        "update zc_own_work",
        "set res_id = #{resId,jdbcType=INTEGER},",
          "uid = #{uid,jdbcType=INTEGER},",
          "company_name = #{companyName,jdbcType=VARCHAR},",
          "industry = #{industry,jdbcType=VARCHAR},",
          "position = #{position,jdbcType=VARCHAR},",
          "salary = #{salary,jdbcType=TINYINT},",
          "describe = #{describe,jdbcType=VARCHAR},",
          "start_time = #{startTime,jdbcType=VARCHAR},",
          "end_time = #{endTime,jdbcType=VARCHAR},",
          "position_cn = #{positionCn,jdbcType=VARCHAR},",
          "position_type = #{positionType,jdbcType=INTEGER},",
          "certifier = #{certifier,jdbcType=VARCHAR},",
          "certifier_phone = #{certifierPhone,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ZcOwnWork record);
}